package com.liang.socketdemo3;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class ClientDemo {
    public static void main(String[] args) throws IOException {
        //创建套接字对象
        Socket socket = new Socket("127.0.0.1",10000);
        //创建写输出流对象，往网络通道中写入数据
        OutputStream os = socket.getOutputStream();

        os.write("nihaoa".getBytes());

        socket.close();
    }
}
